package com.gzu.finalwork.user.mapper;

import com.gzu.finalwork.entity.user.Addresses;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface AddressesMapper {
    //创建地址
    int createAddress(Addresses addresses);
    //更新地址
    int updateAddress(Addresses addresses);
    //删除地址
    int deleteAddress(Long addressId);
    //查询寄件地址
    List<Addresses> selectByUserId(Long userId, int limit,int offset);
    //查询地址数量
    Integer selectCountByUserId(Long userId, Integer isDefault);
    //查询收件地址
    List<Addresses> getByUserId(Long userId,int limit,int offset);
    //根据地址查询地址
    Addresses   selectByFullAddress(String fullAddress);
    //根据用户ID查询默认地址
    Addresses selectDefault(String fullAddress,Integer isDefault);
    //根据地址ID查询地址
    Addresses selectByAddressId(Long addressId);
    //根据用户ID修改地址
    int updateByUserId(Long userId);
    //根据用户id修改默认地址
    int updateDefaultByAddressId(Long addressId);
    //根据用户ID删除地址
    int deleteByUserId(Long userId);
}
